package com.flymobi.wap;

import java.util.List;

import com.flymobi.fw.modules.SM;
import com.flymobi.po.News;
import com.flymobi.util.Pagination;
import com.flymobi.util.WebContext;
import com.flymobi.vo.NewsSearchVo;

public class SearchAction extends WapAction {

	private static final long serialVersionUID = 1L;

	public String webProcess(WebContext context) {
		String key=context.getRequest().getParameter("key");
		NewsSearchVo param = new NewsSearchVo();
		param.setStatus(1L);
		param.setKey(key);
		List<News> newsList = SM.NewsService.list(param, startRow, pagePerSize);
		context.put("newsList", newsList);

		Pagination p = new Pagination(
				SM.NewsService.getCount(param).intValue(), startRow,
				pagePerSize);
		p.setPageUrl("search.html?key=" + key);
		context.put("pagenation", p);

		return "search";
	}

	/*@Override
	public long getActionid() {
		return C.Action.search;
	}*/
}
